﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

/// <summary>
/// 移动视角的行动
/// </summary>
[CreateAssetMenu(menuName = "MyScript/Act/ControllableAct/Chracter1Act/TurnViewAct")]
public class TurnViewAct : ControllableAct
{
    private DegreeEventArgs m_degreeEventArgs = new DegreeEventArgs();

    public override ControllableObjectState Act(ButtonEventArgs args, GameObject gameObject, ControllableObjectState state)
    {
        if (args.GetButtonID() == GameTypeDefine.BUTTON_ID.TURN)
        {
            m_degreeEventArgs.Degree = args.Axis;

            EventMgr.InvokeEvent(GameTypeDefine.EVENT_ID.CAMERA_TURN, m_degreeEventArgs);
        }

        if (args.GetButtonID() == GameTypeDefine.BUTTON_ID.RESET)
        {
            EventMgr.InvokeEvent(GameTypeDefine.EVENT_ID.CAMERA_RESET, m_degreeEventArgs);
        }

        return base.Act(args, gameObject, state);
    }
}
